#include "Bitset.h"
#include "BloomFilter.hpp"
#include <iostream>

void test_bitset()
{
	yiwei::bitset bs(100);
	int a[] = { 4,7,43,64,72,45,78,95,81,62,99 };
	for (auto e : a)
	{
		bs.set(e);
	}

	bs.reset(99);

	for (size_t i = 0; i < 100; i++)
	{
		printf("a[%d] = %d\n", i, bs.test(i));
	}
}

void test_bloomfilter()
{
	yiwei::bloomfilter<> bf(100);

	bf.set("abcd");
	bf.set("aadd");
	bf.set("cbad");

	std::cout << bf.test("abcd") << std::endl;
	std::cout << bf.test("aadd") << std::endl;
	std::cout << bf.test("cbad") << std::endl;

	std::cout << bf.test("efgh") << std::endl;
	std::cout << bf.test("adbc") << std::endl;

}

int main()
{
	//test_bitset();
	test_bloomfilter();
	return 0;
}